import axios from 'axios'
import qs from 'qs'


const maxios=function(url,method,data={}){
    return new Promise((resolve)=>{
        if (method == 'get' || method == 'delete'){
            axios({'url':url,'method':method,'params':qs.stringify(data)}).then(res=>{
                return resolve(res.data)

            })
        }else{
            axios({'url':url,'method':method,'data':qs.stringify(data)}).then(res=>{
                return resolve(res.data)
            })
        }

    })
}

export default maxios